package Exam1;

import java.util.Collections;
import java.util.Set;
import java.util.TreeSet;

public class Test1_gai {
    public static void main(String[] args) {
        Set<Integer> red=new TreeSet<>();
        while(red.size()<6){
            int num=(int)(Math.random()*35)+1;
            red.add(num);
        }
//        System.out.println("红球："+red);
        int blue=(int)(Math.random()*15)+1;
//        System.out.println("蓝球："+blue);
        Set<Integer> result=new TreeSet<>();
        Collections.addAll(result,10,12,30,16,7,17);
        int luckBlue=12;
        int redCount=0;
        for(Integer s:red){
            if(result.contains(s)){
                redCount++;
            }
        }
        if(blue==luckBlue){
            System.out.println("恭喜你中了蓝球！");
            System.out.println("红球中奖："+redCount);

        }
        else{

            System.out.println("红球中奖："+redCount);
        }

    }
}
